<template>
    <div class="home ">
      <van-nav-bar
        title="家庭活动记录"
        left-text="返回"
        left-arrow
      />
      <div class="wrapper">
        <van-cell-group v-for="(item, index) in datalist" :key="index">
          <van-cell center :title="item.title" :label="item.thedate"  @click="showPopup(item.title)" />
        </van-cell-group>
      </div>
    </div>
  </template>
  
  <script lang="ts">
  import { ref } from 'vue';
  import axios from 'axios';
  export default {
    created(){
      this.getActivityData()
    },
    data(){
      return{
        title:"",
        activityname:"",
        seeView:"",
        selectspan:"",
        thedate:"",
        synchronous:"",
        teacher:"",
        reply:"",
        appraise:"",
        datalist:""
      }
    },
    methods:{
    getActivityData(){
      axios.get('/activity').then((res)=>{
        console.log(res);
        console.log(res.data.result.data);
        
        const data=res.data.result.data
        this.datalist=res.data.result.data
      })
      .catch(function(err){
        console.log(err);
      });
    },
    showPopup(title){
      console.log(title)
      this.title=title
      this.$router.push({path:"/inoculate/DetailOne",query:{title : this.title}})
    }
  },
  };
  
  </script>
  
  <style  >
    :root {
    --van-nav-bar-icon-color: white;
    --van-nav-bar-background-color: 		#00BFFF;
    --van-nav-bar-text-color: white;
    --van-nav-bar-title-text-color: white;
    --van-tabs-bottom-bar-color:#00BFFF;
  }
  </style>
  